Optimal. Leaf size=46 \[ -\frac {i a \cos ^3(c+d x)}{3 d}+\frac {a \sin (c+d x)}{d}-\frac {a \sin ^3(c+d x)}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.03, antiderivative size = 46, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {3567, 2713}
\begin {gather*} -\frac {a \sin ^3(c+d x)}{3 d}+\frac {a \sin (c+d x)}{d}-\frac {i a \cos ^3(c+d x)}{3 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2713
Rule 3567
Rubi steps
\begin {align*} \int \cos ^3(c+d x) (a+i a \tan (c+d x)) \, dx &=-\frac {i a \cos ^3(c+d x)}{3 d}+a \int \cos ^3(c+d x) \, dx\\ &=-\frac {i a \cos ^3(c+d x)}{3 d}-\frac {a \text {Subst}\left (\int \left (1-x^2\right ) \, dx,x,-\sin (c+d x)\right )}{d}\\ &=-\frac {i a \cos ^3(c+d x)}{3 d}+\frac {a \sin (c+d x)}{d}-\frac {a \sin ^3(c+d x)}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.02, size = 46, normalized size = 1.00 \begin {gather*} -\frac {i a \cos ^3(c+d x)}{3 d}+\frac {a \sin (c+d x)}{d}-\frac {a \sin ^3(c+d x)}{3 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.27, size = 37, normalized size = 0.80
method | result | size |
derivativedivides | \(\frac {-\frac {i a \left (\cos ^{3}\left (d x +c \right )\right )}{3}+\frac {a \left (\cos ^{2}\left (d x +c \right )+2\right ) \sin \left (d x +c \right )}{3}}{d}\) | \(37\) |
default | \(\frac {-\frac {i a \left (\cos ^{3}\left (d x +c \right )\right )}{3}+\frac {a \left (\cos ^{2}\left (d x +c \right )+2\right ) \sin \left (d x +c \right )}{3}}{d}\) | \(37\) |
risch | \(-\frac {i a \,{\mathrm e}^{3 i \left (d x +c \right )}}{12 d}-\frac {i a \cos \left (d x +c \right )}{4 d}+\frac {3 a \sin \left (d x +c \right )}{4 d}\) | \(43\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 36, normalized size = 0.78 \begin {gather*} -\frac {i \, a \cos \left (d x + c\right )^{3} + {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} a}{3 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.37, size = 42, normalized size = 0.91 \begin {gather*} \frac {{\left (-i \, a e^{\left (4 i \, d x + 4 i \, c\right )} - 6 i \, a e^{\left (2 i \, d x + 2 i \, c\right )} + 3 i \, a\right )} e^{\left (-i \, d x - i \, c\right )}}{12 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 105 vs. \(2 (37) = 74\).
time = 0.14, size = 105, normalized size = 2.28 \begin {gather*} \begin {cases} \frac {\left (- 8 i a d^{2} e^{4 i c} e^{3 i d x} - 48 i a d^{2} e^{2 i c} e^{i d x} + 24 i a d^{2} e^{- i d x}\right ) e^{- i c}}{96 d^{3}} & \text {for}\: d^{3} e^{i c} \neq 0 \\\frac {x \left (a e^{4 i c} + 2 a e^{2 i c} + a\right ) e^{- i c}}{4} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 196 vs. \(2 (40) = 80\).
time = 0.50, size = 196, normalized size = 4.26 \begin {gather*} -\frac {{\left (9 \, a e^{\left (i \, d x + i \, c\right )} \log \left (i \, e^{\left (i \, d x + i \, c\right )} + 1\right ) + 6 \, a e^{\left (i \, d x + i \, c\right )} \log \left (i \, e^{\left (i \, d x + i \, c\right )} - 1\right ) - 9 \, a e^{\left (i \, d x + i \, c\right )} \log \left (-i \, e^{\left (i \, d x + i \, c\right )} + 1\right ) - 6 \, a e^{\left (i \, d x + i \, c\right )} \log \left (-i \, e^{\left (i \, d x + i \, c\right )} - 1\right ) - 3 \, a e^{\left (i \, d x + i \, c\right )} \log \left (i \, e^{\left (i \, d x\right )} + e^{\left (-i \, c\right )}\right ) + 3 \, a e^{\left (i \, d x + i \, c\right )} \log \left (-i \, e^{\left (i \, d x\right )} + e^{\left (-i \, c\right )}\right ) + 4 i \, a e^{\left (4 i \, d x + 4 i \, c\right )} + 24 i \, a e^{\left (2 i \, d x + 2 i \, c\right )} - 12 i \, a\right )} e^{\left (-i \, d x - i \, c\right )}}{48 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.41, size = 54, normalized size = 1.17 \begin {gather*} \frac {2\,a\,\left (-\frac {{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,3{}\mathrm {i}}{4}-\frac {{\cos \left (\frac {3\,c}{2}+\frac {3\,d\,x}{2}\right )}^2\,1{}\mathrm {i}}{4}+\frac {9\,\sin \left (c+d\,x\right )}{8}+\frac {\sin \left (3\,c+3\,d\,x\right )}{8}\right )}{3\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________